package com.winit.openapi.constants;

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

/**
 * API常量
 * 
 * @version <pre>
 * Author   Version     Date        Changes
 * kang.wang    1.0         2014-12-30  Created
 * 
 * </pre>
 * @since 1.
 */
public class ApiConstant {

    public static final String REQUEST_MSG             = "requestMsg";

    public static final String RESPONSE_MSG            = "responseMsg";

    /**
     * 记录客户原始报文
     */
    public static final String SOURCE_INPUT_STRING     = "source_input_string";
    
    public static final String SOURCE_IP                = "source_IP";

    public static final String CONTENT_TYPE_JSON       = "application/json";
    
    public static final String CONTENT_TYPE_XML        = "application/xml";

    public static final String CHARSET_UTF8            = "UTF-8";

    public static final String API_USER                = "apiUser";
    
    public static final String API_DIS_BPARTNER_CODE   = "api_fx_bpartner_code";
    
    public static final String API_DIS_USER            = "api_fx_user";
    
    public static final String API_CLIENT             = "api_client";
    
    public static final String API_APP_KEY             = "api_app_key";

    public static final String API_BPARTNER            = "apiBpartner";

    public static final String API_SOURCE              = "api_source";

    public static final String API_SOURCE_DEFAULT      = "API";
    
    public static final String API_SOURCE_NONE         = "NONE";
    
    public static final String AD_3E_API_SUFFIX        = "/ADInterface/api";
    
    public static final String AD_3E_CONTENT_PATH        = "/api";
    
    public static final String METHOD_POST = "POST";

    public static final String METHOD_GET  = "GET";
    /*
     * API请求序列号
     */
    public static final String API_REQUEST_SEQ  = "api_request_seq";
    
    /*
     * API调用频率，默认为一分钟调用次数
     */
    public static final String API_FREQUENCY_PER_UNIT  = "api_frequency_per_unit";
    
    /**
     * API版本号，默认是1.0，
     */
    public static final String API_VERSION_2 = "2.0";

    /*** 卖家角色 ***/
    public static final Long   SELLER_ROLEID           = 1000074l;
    
    /**
     * 分销商BG_GROUP_ID 
     */
    public static final Long        DISTRIBUTOR_BG_GROUP_ID             = 1000008L;

    public static final Long        USER_ORG_ID        = 1000000L;

    /*** WINIT ***/
    public static final int    SELLER_CLIENTID         = 11;

    public static final int    PAGE_NO_DEFAULT         = 1;

    public static final int    PAGE_SIZE_DEFAULT       = 10;

    public static final int    EXPORT_MAX_COUNT        = 5000;

    public static final String TRUE                    = "true";
    public static final String FALSE                   = "false";
    
    public static final String SHORT_YES               = "Y";
    public static final String SHORT_NO                = "N";
    /** 业务类型 */
    public static final String BUSI_TYPE               = "busiType";
    /** 订单状态PFS */
    public static final String STATUS_SUCCESS          = "SUCCESS";
    
    /** 订单状态WFI 收货验货 */
    public static final String STATUS_WFI          = "WFI";

    /** 面单临时文件存放路径 */
    public static final String PATH_MERGE_PDF_WIN      = "C://tmp//";
    public static final String PATH_MERGE_PDF_LINUX    = "/tmp/";

    /** ISP产品 */
    public static final String PRODUCT_CATALOG_ISP     = "ISP";
    
    /** 海外仓订单类型 */
    public static final String ORDER_TYPE_OUTBOUND      = "OUTBOUND";
    
    
    /** 万邑通产品分区类型---Warehouse */
    public static final String LOGISTIC_TYPE_WAREHOUSE = "Warehouse";
    
    public static final String ISP_ORDER_TPYE_NORMAL = "normal";
    
    public static final String ISP_ORDER_TPYE_EX = "ex";
    
    /**
    * 是否导出错误信息
    */
    public static final String ISP_ORDER_TPYE_EXPROT_ERR_MSG = "Y"; 
    
    /**
     * 设置数据来源
     */
    public static final String SET_SOURCE = "api";
    
    /**
     * 设置数据来源
     */
    public static final String API_PLATFORM_SELLERERP = "SELLERERP";
    
    public static final String API_SOURCE_GFS      = "GFS";
    
    /**
     * 进口包裹总价值最大不得超过100000000
     * 只是用作API字段校验，防止保存的时候数据库报错
     */
    public static final BigDecimal    ISP_IMPORT_SALE_PRICE       = BigDecimal.valueOf(99999999.99d);
    
    /**
     * 进口包裹重量最大不得超过100000000KG
     * 实际上不会有这么重的包裹，只是用作API字段校验，防止保存的时候数据库报错
     */
    public static final BigDecimal    ISP_IMPORT_GROSS_MAX        = BigDecimal.valueOf(99999999.99d);
  

    /**
     * 运输方式为【快递】的运输方式编码【EXPRESS】
     */
    public static String       TRANSPORTMODECODE       = "EXPRESS";
    
    // 多语言类型
    public static final String     LANGUAGE_ZH_CN                         = "zh_CN";
    public static final String     LANGUAGE_ZH_TW                         = "zh_TW";
    public static final String     LANGUAGE_EN_US                         = "en_US";
    /**
     * 快递来源
     */
    public static final String EXPRESSSOURCE =  "kuaidi100";

 // 产品语言规则
    public static final String     RULE_NAME_LANG                         = "LANG";
    // 寄件人地址语言
    public static final String     RULE_ATTRIBUTE_SHIPPER_ADDR            = "ShipperAddrLang";
    
    public static final String     EBAY_UPLOAD_TRACKINGNO_NAME            = "EBAY_UPLOAD_TRACKINGNO";
    public static final String     EBAY_UPLOAD_TRACKINGNO_CATEGORY_ISP        = "ISP";
    public static final String     EBAY_UPLOAD_TRACKINGNO_Y        = "Y";
    public static final String     EBAY_UPLOAD_TRACKINGNO_N        = "N";
    
    
    //是否不校验收件人州
    public static final String     IS_NOTVALIDATE_STATE  = "isNotValidateState";
    //是否不校验收件人城市
    public static final String     IS_NOTVALIDATE_CITY  = "isNotValidateCity";
    //是否不校验收件人电话
    public static final String     IS_NOTVALIDATE_PHONE  = "isNotValidatePhone";
    //是否不校验包裹长
    public static final String     IS_NOTVALIDATE_LENGTH  = "isNotValidateLength";
    //是否不校验包裹宽
    public static final String     IS_NOTVALIDATE_WIDTH  = "isNotValidateWidth";
    //是否不校验包裹高
    public static final String     IS_NOTVALIDATE_HEIGHT  = "isNotValidateHeight";
    
    /**
     * 发货类型：提货
     */
    public static final String     DISPATCH_TYPE_PICK_UP                  = "P";

    /**
     * 发货类型： 卖家直发
     */
    public static final String     DISPATCH_TYPE_SELLER                   = "S";

    /**
     * 发货类型： 中邮揽收
     */
    public static final String     DISPATCH_TYPE_CHINAPOST                = "C";
    
    /**
     * 发货类型： 卖家自送
     */
    public static final String     DISPATCH_TYPE_SELF                     = "T";
    
    /**
     * 发货类型： DHL揽收
     */
    public static final String     DISPATCH_TYPE_DHL               		  = "D";
    
    /**
     * 发货类型
     */
    public static final Set<String> DISPATCH_TYPE_SET = new HashSet<String>();
    
    static{
        DISPATCH_TYPE_SET.add(DISPATCH_TYPE_PICK_UP);
        DISPATCH_TYPE_SET.add(DISPATCH_TYPE_SELLER);
        DISPATCH_TYPE_SET.add(DISPATCH_TYPE_CHINAPOST);
        DISPATCH_TYPE_SET.add(DISPATCH_TYPE_SELF);
        DISPATCH_TYPE_SET.add(DISPATCH_TYPE_DHL);
    }
    
    public class HandlerType{
        
        public static final String HANDLER_TYPE_AUTO = "A";
        public static final String HANDLER_TYPE_MANUAL = "M";
    }
    
    /**
     * 中华邮政产品编码
     */
    public static final String     TWPOST_CODE = "ISP0255";
    
    public static final String     COUNTRY_CODE_CN = "CN";
    
    public static final String    IS_ACTIVE_Y="Y";
    public static final String    IS_ACTIVE_N="N";
}
